import torch
batch_size = 5     # 批量大小
seq_len = 6        # 序列长度或时间步
input_size = 4     # 输入特征维度
hidden_size = 2    # 隐藏层神经元个数
num_layers = 3      # 隐藏层的层数
cell=torch.nn.RNN(input_size=input_size, 
                      hidden_size=hidden_size, 
                      num_layers=num_layers)
# 输入数据的维度：(seqLen, batchSize, inputSize)
inputs = torch.randn(seq_len, batch_size, input_size)
h0 = torch.zeros(num_layers, batch_size, hidden_size)
out, hidden = cell(inputs, h0) 

print("Output size:", out.shape)
print("Output:", out)
print("Hidden:",hidden) 
